package com.beiding.workordersystem.common.utils;

import org.springframework.context.ApplicationContext;

public class ApplicationUtils {

    private static ApplicationContext context;

    public static void init(ApplicationContext context) {
        ApplicationUtils.context = context;
    }

    public static <T> T get(Class<T> tClass) {
        return context.getBean(tClass);
    }

    public static <T> T get(T t) {
        return (T) get(t.getClass());
    }

}
